kzs_input.h File Reference

Input device handling. More...

Classes

struct  KzsEventQueueIterator
 Iterator for event queues. More...
 

Macros

#define KZS_POINTING_DEVICE_BUTTON_PRIMARY
 Primary pointer button, e.g. More...
 
#define KZS_POINTING_DEVICE_BUTTON_SECONDARY
 Secondary pointer button, e.g. More...
 
#define KZS_POINTING_DEVICE_BUTTON_TERTIARY
 Tertiary pointer button, e.g. More...
 
#define kzsEventQueueIteratorIterate(it)
 Iterate an event queue iterator. More...
 
#define kzsEventQueueIteratorGetValue(it)
 Get the current value of an event queue iterator. More...
 

Typedefs

typedef kzsError(* KzsEventHandleFunction) (const struct KzsEventQueue *queue, void *userData)
 Callback function type for event handling. More...
 

Enumerations

enum  KzsWindowOrientation { KZS_WINDOW_ORIENTATION_LANDSCAPE, KZS_WINDOW_ORIENTATION_PORTRAIT, KZS_WINDOW_ORIENTATION_COUNT }
 List of window orientation. More...
 
enum  KzsEventType {
  KZS_EVENT_NONE, KZS_EVENT_KEY, KZS_EVENT_POINTER, KZS_EVENT_TOUCH,
  KZS_EVENT_WINDOW_RESIZED, KZS_EVENT_WINDOW_RESIZE_REQUESTED, KZS_EVENT_WINDOW_FOCUS_LOST, KZS_EVENT_WINDOW_FOCUS_GAINED,
  KZS_EVENT_WINDOW_HIDDEN, KZS_EVENT_WINDOW_RESOURCES_LOST, KZS_EVENT_DISPLAY_ORIENTATION_CHANGED, KZS_EVENT_WINDOW_CLOSED,
  KZS_EVENT_APPLICATION_PAUSED, KZS_EVENT_APPLICATION_SLEEP, KZS_EVENT_APPLICATION_WAKEUP, KZS_EVENT_DEBUG_TOGGLE_HUD,
  KZS_EVENT_DEBUG_SET_HUD
}
 Enumeration for different types of events. More...
 
enum  KzsInputTranslation {
  KZS_INPUT_TRANSLATE_NONE, KZS_INPUT_TRANSLATE_POINTER_TO_TOUCH, KZS_INPUT_TRANSLATE_TOUCH_TO_POINTER, KZS_INPUT_TRANSLATE_POINTER_TO_TOUCH_PRESERVE,
  KZS_INPUT_TRANSLATE_TOUCH_TO_POINTER_PRESERVE
}
 Enumeration to select translation of events. More...
 
enum  KzsInputPointingDeviceState {
  KZS_POINTING_DEVICE_STATE_DOWN, KZS_POINTING_DEVICE_STATE_MOVE, KZS_POINTING_DEVICE_STATE_DRAG, KZS_POINTING_DEVICE_STATE_UP,
  KZS_POINTING_DEVICE_STATE_SCROLL
}
 Enumeration for different states for a pointing device. More...
 
enum  KzsInputCursorState { KZS_CURSOR_STATE_DOWN, KZS_CURSOR_STATE_STATIONARY, KZS_CURSOR_STATE_MOVE, KZS_CURSOR_STATE_UP }
 Enumeration for the state of a single cursor (as opposed to the state of the whole device. More...
 
enum  KzsInputTouchState { KZS_TOUCH_STATE_BEGIN, KZS_TOUCH_STATE_CONTINUE, KZS_TOUCH_STATE_END }
 Enumeration for different states for a touch device. More...
 
enum  KzsInputKeyDeviceState { KZS_KEY_DEVICE_STATE_DOWN, KZS_KEY_DEVICE_STATE_UP, KZS_KEY_DEVICE_STATE_REPEAT }
 Enumeration for different states for a key device. More...
 
enum  KzsInputKey {
  KZS_KEY_UNKNOWN, KZS_KEY_0, KZS_KEY_1, KZS_KEY_2,
  KZS_KEY_3, KZS_KEY_4, KZS_KEY_5, KZS_KEY_6,
  KZS_KEY_7, KZS_KEY_8, KZS_KEY_9, KZS_KEY_COMMA,
  KZS_KEY_PERIOD, KZS_KEY_DECIMAL_SEPARATOR, KZS_KEY_THOUSANDS_SEPARATOR, KZS_KEY_A,
  KZS_KEY_B, KZS_KEY_C, KZS_KEY_D, KZS_KEY_E,
  KZS_KEY_F, KZS_KEY_G, KZS_KEY_H, KZS_KEY_I,
  KZS_KEY_J, KZS_KEY_K, KZS_KEY_L, KZS_KEY_M,
  KZS_KEY_N, KZS_KEY_O, KZS_KEY_P, KZS_KEY_Q,
  KZS_KEY_R, KZS_KEY_S, KZS_KEY_T, KZS_KEY_U,
  KZS_KEY_V, KZS_KEY_W, KZS_KEY_X, KZS_KEY_Y,
  KZS_KEY_Z, KZS_KEY_SPACE, KZS_KEY_BACKSPACE, KZS_KEY_ENTER,
  KZS_KEY_TAB, KZS_KEY_ESC, KZS_KEY_CAPS_LOCK, KZS_KEY_NUM_LOCK,
  KZS_KEY_PRINT_SCREEN, KZS_KEY_SCROLL_LOCK, KZS_KEY_BREAK, KZS_KEY_INSERT,
  KZS_KEY_DELETE, KZS_KEY_HOME, KZS_KEY_END, KZS_KEY_PAGE_UP,
  KZS_KEY_PAGE_DOWN, KZS_KEY_PLUS, KZS_KEY_MINUS, KZS_KEY_MULTIPLY,
  KZS_KEY_DIVIDE, KZS_KEY_ARROW_UP, KZS_KEY_ARROW_DOWN, KZS_KEY_ARROW_LEFT,
  KZS_KEY_ARROW_RIGHT, KZS_KEY_NUM_0, KZS_KEY_NUM_1, KZS_KEY_NUM_2,
  KZS_KEY_NUM_3, KZS_KEY_NUM_4, KZS_KEY_NUM_5, KZS_KEY_NUM_6,
  KZS_KEY_NUM_7, KZS_KEY_NUM_8, KZS_KEY_NUM_9, KZS_KEY_NUM_DIVIDE,
  KZS_KEY_NUM_MULTIPLY, KZS_KEY_NUM_PLUS, KZS_KEY_NUM_MINUS, KZS_KEY_NUM_COMMA,
  KZS_KEY_NUM_ENTER, KZS_KEY_F1, KZS_KEY_F2, KZS_KEY_F3,
  KZS_KEY_F4, KZS_KEY_F5, KZS_KEY_F6, KZS_KEY_F7,
  KZS_KEY_F8, KZS_KEY_F9, KZS_KEY_F10, KZS_KEY_F11,
  KZS_KEY_F12, KZS_KEY_VOLUME_UP, KZS_KEY_VOLUME_DOWN, KZS_KEY_SOFTKEY1,
  KZS_KEY_SOFTKEY2, KZS_KEY_SOFTKEY3, KZS_KEY_SOFTKEY4, KZS_KEY_MODIFIER1,
  KZS_KEY_MODIFIER2, KZS_KEY_MODIFIER3, KZS_KEY_RIGHT_ALT, KZS_KEY_RIGHT_CONTROL,
  KZS_KEY_RIGHT_SHIFT, KZS_KEY_RIGHT_WINDOWS_KEY, KZS_KEY_LEFT_ALT, KZS_KEY_LEFT_CONTROL,
  KZS_KEY_LEFT_SHIFT, KZS_KEY_LEFT_WINDOWS_KEY, KZS_KEY_MENU_KEY, KZS_KEY_SECTION,
  KZS_KEY_QUOTE, KZS_KEY_LESS_THAN, KZS_KEY_UMLAUT, KZS_KEY_AUML,
  KZS_KEY_OUML, KZS_KEY_ARING, KZS_KEY_ACCENT, KZS_KEY_BUTTON_A,
  KZS_KEY_BUTTON_B, KZS_KEY_BUTTON_C, KZS_KEY_BUTTON_X, KZS_KEY_BUTTON_Y,
  KZS_KEY_BUTTON_Z, KZS_KEY_BUTTON_L1, KZS_KEY_BUTTON_L2, KZS_KEY_BUTTON_R1,
  KZS_KEY_BUTTON_R2, KZS_KEY_BUTTON_SELECT, KZS_KEY_BUTTON_START, KZS_KEY_BUTTON_THUMBL,
  KZS_KEY_BUTTON_THUMBR, KZS_KEY_BUTTON_MODE, KZS_KEY_COUNT
}
 Platform independent key enumeration. More...
 

Functions

KANZI_API kzsError kzsEventQueueCreate (struct KzsEventQueue **queue_out)
 Creates a new event queue. More...
 
KANZI_API void kzsEventQueueDelete (struct KzsEventQueue *queue)
 Frees memory allocated for a input event queue. More...
 
KANZI_API struct KzsEventQueueIterator kzsEventQueueGetIterator (const struct KzsEventQueue *queue)
 Get an iterator over an event queue. More...
 
KANZI_API kzBool kzsEventQueueIteratorIterate_private (struct KzsEventQueueIterator *it)
 Internal iteration. More...
 
KANZI_API struct KzsEvent * kzsEventQueueIteratorGetValue_private (const struct KzsEventQueueIterator *it)
 Internal iteration get value. More...
 
KANZI_API struct KzsEvent * kzsEventQueueGetEvent (const struct KzsEventQueue *queue, kzUint index)
 Get nth event from an event queue. More...
 
KANZI_API kzUint kzsEventQueueGetEventCount (const struct KzsEventQueue *queue)
 Get the number of events in an event queue. More...
 
KANZI_API void kzsEventQueueClear (struct KzsEventQueue *queue)
 Clear all events from an event queue. More...
 
KANZI_API void kzsEventQueueSwap (struct KzsEventQueue *queue1, struct KzsEventQueue *queue2)
 Swap contents of two queues. More...
 
KANZI_API void kzsEventInvalidate (struct KzsEvent *event)
 Renders an event idempotent. More...
 
KANZI_API struct KzsEvent * kzsEventCreateKeyEvent (kzUint button, enum KzsInputKeyDeviceState state)
 Creates a new key event with input values. More...
 
KANZI_API void kzsEventDeleteKeyEvent (struct KzsEvent *event)
 Frees memory allocated for a input event. More...
 
KANZI_API struct KzsEvent * kzsEventQueueAddRawEvent (struct KzsEventQueue *queue, const struct KzsEvent *event)
 Adds a new event into the queue. More...
 
KANZI_API struct KzsEvent * kzsEventQueueAddKeyEvent (struct KzsEventQueue *queue, kzUint button, enum KzsInputKeyDeviceState state)
 Adds a new key event into the queue with input values. More...
 
KANZI_API struct KzsEvent * kzsEventQueueAddPointerEvent (struct KzsEventQueue *queue, kzInt x, kzInt y, kzU32 buttons, kzInt scroll, enum KzsInputPointingDeviceState state)
 Adds a new pointer event into the queue with input values. More...
 
KANZI_API struct KzsEvent * kzsEventQueueAddTouchEvent (struct KzsEventQueue *queue, kzUint numCursors)
 Adds a new touch event. More...
 
KANZI_API struct KzsEvent * kzsEventQueueAddTouchEventWithState (struct KzsEventQueue *queue, kzUint numCursors, enum KzsInputTouchState state)
 As add touch event, but with a state already set now. More...
 
KANZI_API struct KzsEvent * kzsEventQueueAddTouchEventWithDetails (struct KzsEventQueue *queue, enum KzsInputTouchState state, enum KzsInputCursorState cursorState, kzFloat x, kzFloat y)
 As add touch event with details. More...
 
KANZI_API struct KzsEvent * kzsEventQueueAddSimpleWindowEvent (struct KzsEventQueue *queue, enum KzsEventType type, struct KzsWindow *window)
 Adds a new window event into the queue. More...
 
KANZI_API struct KzsEvent * kzsEventQueueAddWindowResizeEvent (struct KzsEventQueue *queue, struct KzsWindow *window, kzUint width, kzUint height)
 Adds a new window resize event into the queue. More...
 
KANZI_API struct KzsEvent * kzsEventQueueAddWindowResizeRequestedEvent (struct KzsEventQueue *queue, struct KzsWindow *window, kzUint width, kzUint height)
 Adds a new window resize request event into the queue. More...
 
KANZI_API struct KzsEvent * kzsEventQueueAddWindowOrientationChangeEvent (struct KzsEventQueue *queue, struct KzsWindow *window, enum KzsWindowOrientation orientation)
 Adds a new orientation change event into the queue. More...
 
KANZI_API struct KzsEvent * kzsEventQueueAddApplicationPausedEvent (struct KzsEventQueue *queue)
 Adds a new application paused event. More...
 
KANZI_API struct KzsEvent * kzsEventQueueAddApplicationSleepEvent (struct KzsEventQueue *queue)
 Adds a new application sleep event. More...
 
KANZI_API struct KzsEvent * kzsEventQueueAddApplicationWakeupEvent (struct KzsEventQueue *queue)
 Adds a new application wakeup event. More...
 
KANZI_API struct KzsEvent * kzsEventQueueAddToggleHUDDebugEvent (struct KzsEventQueue *queue)
 Adds a new toggle HUD debug event into the queue. More...
 
KANZI_API struct KzsEvent * kzsEventQueueAddSetHUDDebugEvent (struct KzsEventQueue *queue, kzInt onoff)
 Adds a new set HUD debug event into the queue. More...
 
KANZI_API const struct KzsInputEventPointer * kzsInputEventGetPointingDeviceData (const struct KzsEvent *event)
 Get the pointer event from an input event. More...
 
KANZI_API const struct KzsInputEventKey * kzsInputEventGetKeyDeviceData (const struct KzsEvent *event)
 Get key event from an input event. More...
 
KANZI_API const struct KzsInputEventTouch * kzsInputEventGetTouchData (const struct KzsEvent *event)
 Get touch event from an input event. More...
 
KANZI_API enum KzsEventType kzsEventGetType (const struct KzsEvent *event)
 Get the event type. More...
 
KANZI_API kzUint kzsInputCursorGetId (const struct KzsInputCursor *inputdata)
 Get the identifier of the touch cursor. More...
 
KANZI_API kzFloat kzsInputCursorGetPressure (const struct KzsInputCursor *inputData)
 Gets the pressure of the touch cursor. More...
 
KANZI_API kzFloat kzsInputCursorGetRadius (const struct KzsInputCursor *inputData)
 Gets the radius of the touch cursor. More...
 
KANZI_API kzFloat kzsInputCursorGetX (const struct KzsInputCursor *inputData)
 Get the x coordinate of touch cursor. More...
 
KANZI_API kzFloat kzsInputCursorGetY (const struct KzsInputCursor *inputData)
 Get the y coordinate of touch cursor. More...
 
KANZI_API enum KzsInputCursorState kzsInputCursorGetState (const struct KzsInputCursor *inputdata)
 Get the state of the touch cursor. More...
 
KANZI_API kzUint kzsInputEventKeyGetButtonRaw (const struct KzsInputEventKey *inputData)
 Gets the raw button code of the key device. More...
 
KANZI_API enum KzsInputKey kzsInputEventKeyGetButton (const struct KzsInputEventKey *inputData)
 Gets the translated button of the key device. More...
 
KANZI_API enum KzsInputKeyDeviceState kzsInputEventKeyGetState (const struct KzsInputEventKey *inputData)
 Gets the state of the key device. More...
 
KANZI_API kzU32 kzsInputEventPointerGetButtons (const struct KzsInputEventPointer *inputData)
 Gets the bitfield of the buttons of the active pointing device. More...
 
KANZI_API kzInt kzsInputEventPointerGetScroll (const struct KzsInputEventPointer *inputData)
 Gets the scroll amount of the active pointing device. More...
 
KANZI_API enum KzsInputPointingDeviceState kzsInputEventPointerGetState (const struct KzsInputEventPointer *inputData)
 Gets the state of the active pointing device. More...
 
KANZI_API kzInt kzsInputEventPointerGetX (const struct KzsInputEventPointer *inputData)
 Gets the x coordinate of the active pointing device. More...
 
KANZI_API kzInt kzsInputEventPointerGetY (const struct KzsInputEventPointer *inputData)
 Gets the y coordinate of the active pointing device. More...
 
KANZI_API struct KzsInputCursor * kzsInputEventTouchGetCursor (const struct KzsInputEventTouch *inputData, kzUint cursorIdx)
 Get the nth cursor form a touch event. More...
 
KANZI_API kzUint kzsInputEventTouchGetCursorCount (const struct KzsInputEventTouch *inputData)
 Get the number of cursors in this event. More...
 
KANZI_API enum KzsInputTouchState kzsInputEventTouchGetState (const struct KzsInputEventTouch *inputData)
 Get the touch state. More...
 
KANZI_API kzBool kzsInputEventTouchSetCursor (struct KzsEventQueue *queue, struct KzsEvent *event, kzUint cursorIndex, kzUint cursorId, kzFloat x, kzFloat y, kzFloat pressure, kzFloat radius, enum KzsInputCursorState state)
 Add a cursor to a touch event. More...
 
KANZI_API void kzsInputEventTouchSetState (struct KzsEvent *event, enum KzsInputTouchState state)
 Set the state of touch event. More...
 
KANZI_API struct KzsWindowkzsWindowEventGetTarget (const struct KzsEvent *event)
 Get the target window of the event. More...
 
KANZI_API kzUint kzsWindowEventResizeGetWidth (const struct KzsEvent *event)
 Get the window width of a resize event. More...
 
KANZI_API kzUint kzsWindowEventResizeGetHeight (const struct KzsEvent *event)
 Get the window height of a resize event. More...
 
KANZI_API enum KzsWindowOrientation kzsWindowEventOrientationChangeGetOrientation (const struct KzsEvent *event)
 Get the window orientation of a orientation change event. More...
 
KANZI_API enum KzsInputKey kzsInputNativeGetTranslatedKey (kzUint button)
 Returns the translated key. More...
 
KANZI_API const struct KzsDebugEventSetHUD * kzsEventGetSetHUDData (const struct KzsEvent *event)
 Get set HUD event data from an event. More...
 
KANZI_API kzInt kzsSetHUDDebugEventGetOnOff (const struct KzsDebugEventSetHUD *inputData)
 Returns set HUD debug event parameter. More...
 

Detailed Description

Input device handling.

Keyboards, mice, touch screens, joysticks and similar devices.

Copyright 2008-2017 by Rightware. All rights reserved.

Macro Definition Documentation

#define KZS_POINTING_DEVICE_BUTTON_PRIMARY

Primary pointer button, e.g.

usually mouse left on Windows.

#define KZS_POINTING_DEVICE_BUTTON_SECONDARY

Secondary pointer button, e.g.

usually mouse right on Windows.

#define KZS_POINTING_DEVICE_BUTTON_TERTIARY

Tertiary pointer button, e.g.

usually mouse middle on Windows.

#define kzsEventQueueIteratorIterate (   it)

Iterate an event queue iterator.

Return true if this value is still valid.

#define kzsEventQueueIteratorGetValue (   it)

Get the current value of an event queue iterator.

Typedef Documentation

typedef kzsError(* KzsEventHandleFunction) (const struct KzsEventQueue *queue, void *userData)

Callback function type for event handling.

Enumeration Type Documentation

List of window orientation.

Enumerator
KZS_WINDOW_ORIENTATION_LANDSCAPE 

LANDSCAPE.

KZS_WINDOW_ORIENTATION_PORTRAIT 

PORTRAIT.

KZS_WINDOW_ORIENTATION_COUNT 

Last enum value for validation checks.

Enumeration for different types of events.

Enumerator
KZS_EVENT_NONE 

Should be handled as unused.

KZS_EVENT_KEY 

Key press or release.

KZS_EVENT_POINTER 

Pointer movement or press action.

KZS_EVENT_TOUCH 

Touch event.

One finger or more.

KZS_EVENT_WINDOW_RESIZED 

Window has been resized.

KZS_EVENT_WINDOW_RESIZE_REQUESTED 

Window resize has been requested.

KZS_EVENT_WINDOW_FOCUS_LOST 

Window has lost input focus but it may still be completely or partially visible.

KZS_EVENT_WINDOW_FOCUS_GAINED 

Window has gained input focus and is fully visible.

KZS_EVENT_WINDOW_HIDDEN 

Window has been minimized or completely hidden and/or a power saver or screen saver is enabled.

Rendering should be disabled.

KZS_EVENT_WINDOW_RESOURCES_LOST 

Window has lost the resources it has used.

Application may need to be restarted or reinitialized.

KZS_EVENT_DISPLAY_ORIENTATION_CHANGED 

Display orientation has been changed.

KZS_EVENT_WINDOW_CLOSED 

Window has been closed.

KZS_EVENT_APPLICATION_PAUSED 

Application will be paused.

KZS_EVENT_APPLICATION_SLEEP 

Application will be put to sleep by the operating system.

KZS_EVENT_APPLICATION_WAKEUP 

Application has been waken up by the operating system.

KZS_EVENT_DEBUG_TOGGLE_HUD 

Toggle HUD debug request.

KZS_EVENT_DEBUG_SET_HUD 

Set HUD debug request.

Enumeration to select translation of events.

Enumerator
KZS_INPUT_TRANSLATE_NONE 

Do not translate anything, receive both touch and pointer events.

KZS_INPUT_TRANSLATE_POINTER_TO_TOUCH 

Translate all pointer events to touch events.

Disable pointer events.

KZS_INPUT_TRANSLATE_TOUCH_TO_POINTER 

Translate all touch events to pointer events.

Disable touch events.

KZS_INPUT_TRANSLATE_POINTER_TO_TOUCH_PRESERVE 

Translate all pointer events to touch events.

Preserve pointer events.

KZS_INPUT_TRANSLATE_TOUCH_TO_POINTER_PRESERVE 

Translate all touch events to pointer events.

Preserve pointer events.

Enumeration for different states for a pointing device.

Enumerator
KZS_POINTING_DEVICE_STATE_DOWN 

Pressed.

KZS_POINTING_DEVICE_STATE_MOVE 

Pointer moved.

Not all platforms support this, for example many touch screens.

KZS_POINTING_DEVICE_STATE_DRAG 

Pointer dragged.

KZS_POINTING_DEVICE_STATE_UP 

Released.

KZS_POINTING_DEVICE_STATE_SCROLL 

Scrolled.

Not all platforms support this, but can be used for example to mouse wheel.

Enumeration for the state of a single cursor (as opposed to the state of the whole device.

Enumerator
KZS_CURSOR_STATE_DOWN 

First finger down.

KZS_CURSOR_STATE_STATIONARY 

First finger down.

KZS_CURSOR_STATE_MOVE 

First finger down.

KZS_CURSOR_STATE_UP 

First finger down.

Enumeration for different states for a touch device.

Enumerator
KZS_TOUCH_STATE_BEGIN 

First finger down.

KZS_TOUCH_STATE_CONTINUE 

Gesture or touch event in progress.

KZS_TOUCH_STATE_END 

Last finger up.

Enumeration for different states for a key device.

Enumerator
KZS_KEY_DEVICE_STATE_DOWN 

Pressed.

KZS_KEY_DEVICE_STATE_UP 

Released.

KZS_KEY_DEVICE_STATE_REPEAT 

Key is being held.

Platform independent key enumeration.

Enumerator
KZS_KEY_UNKNOWN 
KZS_KEY_0 
KZS_KEY_1 
KZS_KEY_2 
KZS_KEY_3 
KZS_KEY_4 
KZS_KEY_5 
KZS_KEY_6 
KZS_KEY_7 
KZS_KEY_8 
KZS_KEY_9 
KZS_KEY_COMMA 
KZS_KEY_PERIOD 
KZS_KEY_DECIMAL_SEPARATOR 

allows for locale specific separator key mapping

KZS_KEY_THOUSANDS_SEPARATOR 

allows for locale specific separator key mapping

KZS_KEY_A 
KZS_KEY_B 
KZS_KEY_C 
KZS_KEY_D 
KZS_KEY_E 
KZS_KEY_F 
KZS_KEY_G 
KZS_KEY_H 
KZS_KEY_I 
KZS_KEY_J 
KZS_KEY_K 
KZS_KEY_L 
KZS_KEY_M 
KZS_KEY_N 
KZS_KEY_O 
KZS_KEY_P 
KZS_KEY_Q 
KZS_KEY_R 
KZS_KEY_S 
KZS_KEY_T 
KZS_KEY_U 
KZS_KEY_V 
KZS_KEY_W 
KZS_KEY_X 
KZS_KEY_Y 
KZS_KEY_Z 
KZS_KEY_SPACE 
KZS_KEY_BACKSPACE 
KZS_KEY_ENTER 
KZS_KEY_TAB 
KZS_KEY_ESC 
KZS_KEY_CAPS_LOCK 
KZS_KEY_NUM_LOCK 
KZS_KEY_PRINT_SCREEN 
KZS_KEY_SCROLL_LOCK 
KZS_KEY_BREAK 
KZS_KEY_INSERT 
KZS_KEY_DELETE 
KZS_KEY_HOME 
KZS_KEY_END 
KZS_KEY_PAGE_UP 
KZS_KEY_PAGE_DOWN 
KZS_KEY_PLUS 
KZS_KEY_MINUS 
KZS_KEY_MULTIPLY 
KZS_KEY_DIVIDE 
KZS_KEY_ARROW_UP 
KZS_KEY_ARROW_DOWN 
KZS_KEY_ARROW_LEFT 
KZS_KEY_ARROW_RIGHT 
KZS_KEY_NUM_0 
KZS_KEY_NUM_1 
KZS_KEY_NUM_2 
KZS_KEY_NUM_3 
KZS_KEY_NUM_4 
KZS_KEY_NUM_5 
KZS_KEY_NUM_6 
KZS_KEY_NUM_7 
KZS_KEY_NUM_8 
KZS_KEY_NUM_9 
KZS_KEY_NUM_DIVIDE 
KZS_KEY_NUM_MULTIPLY 
KZS_KEY_NUM_PLUS 
KZS_KEY_NUM_MINUS 
KZS_KEY_NUM_COMMA 
KZS_KEY_NUM_ENTER 
KZS_KEY_F1 
KZS_KEY_F2 
KZS_KEY_F3 
KZS_KEY_F4 
KZS_KEY_F5 
KZS_KEY_F6 
KZS_KEY_F7 
KZS_KEY_F8 
KZS_KEY_F9 
KZS_KEY_F10 
KZS_KEY_F11 
KZS_KEY_F12 
KZS_KEY_VOLUME_UP 
KZS_KEY_VOLUME_DOWN 
KZS_KEY_SOFTKEY1 
KZS_KEY_SOFTKEY2 
KZS_KEY_SOFTKEY3 
KZS_KEY_SOFTKEY4 
KZS_KEY_MODIFIER1 
KZS_KEY_MODIFIER2 
KZS_KEY_MODIFIER3 
KZS_KEY_RIGHT_ALT 
KZS_KEY_RIGHT_CONTROL 
KZS_KEY_RIGHT_SHIFT 
KZS_KEY_RIGHT_WINDOWS_KEY 
KZS_KEY_LEFT_ALT 
KZS_KEY_LEFT_CONTROL 
KZS_KEY_LEFT_SHIFT 
KZS_KEY_LEFT_WINDOWS_KEY 
KZS_KEY_MENU_KEY 
KZS_KEY_SECTION 

left of 1

KZS_KEY_QUOTE 

left of enter, below

KZS_KEY_LESS_THAN 

left of Z

KZS_KEY_UMLAUT 

left of enter, above

KZS_KEY_AUML 

right of OUML

KZS_KEY_OUML 

right of L

KZS_KEY_ARING 

right of P

KZS_KEY_ACCENT 

left of backspace

KZS_KEY_BUTTON_A 
KZS_KEY_BUTTON_B 
KZS_KEY_BUTTON_C 
KZS_KEY_BUTTON_X 
KZS_KEY_BUTTON_Y 
KZS_KEY_BUTTON_Z 
KZS_KEY_BUTTON_L1 
KZS_KEY_BUTTON_L2 
KZS_KEY_BUTTON_R1 
KZS_KEY_BUTTON_R2 
KZS_KEY_BUTTON_SELECT 
KZS_KEY_BUTTON_START 
KZS_KEY_BUTTON_THUMBL 
KZS_KEY_BUTTON_THUMBR 
KZS_KEY_BUTTON_MODE 
KZS_KEY_COUNT 

Function Documentation

KANZI_API kzsError kzsEventQueueCreate ( struct KzsEventQueue **  queue_out)

Creates a new event queue.

KANZI_API void kzsEventQueueDelete ( struct KzsEventQueue *  queue)

Frees memory allocated for a input event queue.

KANZI_API struct KzsEventQueueIterator kzsEventQueueGetIterator ( const struct KzsEventQueue *  queue)

Get an iterator over an event queue.

KANZI_API kzBool kzsEventQueueIteratorIterate_private ( struct KzsEventQueueIterator it)

Internal iteration.

KANZI_API struct KzsEvent* kzsEventQueueIteratorGetValue_private ( const struct KzsEventQueueIterator it)

Internal iteration get value.

KANZI_API struct KzsEvent* kzsEventQueueGetEvent ( const struct KzsEventQueue *  queue,
kzUint  index 
)

Get nth event from an event queue.

KANZI_API kzUint kzsEventQueueGetEventCount ( const struct KzsEventQueue *  queue)

Get the number of events in an event queue.

KANZI_API void kzsEventQueueClear ( struct KzsEventQueue *  queue)

Clear all events from an event queue.

KANZI_API void kzsEventQueueSwap ( struct KzsEventQueue *  queue1,
struct KzsEventQueue *  queue2 
)

Swap contents of two queues.

KANZI_API void kzsEventInvalidate ( struct KzsEvent *  event)

Renders an event idempotent.

KANZI_API struct KzsEvent* kzsEventCreateKeyEvent ( kzUint  button,
enum KzsInputKeyDeviceState  state 
)

Creates a new key event with input values.

KANZI_API void kzsEventDeleteKeyEvent ( struct KzsEvent *  event)

Frees memory allocated for a input event.

KANZI_API struct KzsEvent* kzsEventQueueAddRawEvent ( struct KzsEventQueue *  queue,
const struct KzsEvent *  event 
)

Adds a new event into the queue.

KANZI_API struct KzsEvent* kzsEventQueueAddKeyEvent ( struct KzsEventQueue *  queue,
kzUint  button,
enum KzsInputKeyDeviceState  state 
)

Adds a new key event into the queue with input values.

KANZI_API struct KzsEvent* kzsEventQueueAddPointerEvent ( struct KzsEventQueue *  queue,
kzInt  x,
kzInt  y,
kzU32  buttons,
kzInt  scroll,
enum KzsInputPointingDeviceState  state 
)

Adds a new pointer event into the queue with input values.

If translating to touch events, add a touch event with one cursor instead.

KANZI_API struct KzsEvent* kzsEventQueueAddTouchEvent ( struct KzsEventQueue *  queue,
kzUint  numCursors 
)

Adds a new touch event.

The touch event generated will have a specified number of cursors. The cursors must be filled separately to the event structure returned from this function.

KANZI_API struct KzsEvent* kzsEventQueueAddTouchEventWithState ( struct KzsEventQueue *  queue,
kzUint  numCursors,
enum KzsInputTouchState  state 
)

As add touch event, but with a state already set now.

KANZI_API struct KzsEvent* kzsEventQueueAddTouchEventWithDetails ( struct KzsEventQueue *  queue,
enum KzsInputTouchState  state,
enum KzsInputCursorState  cursorState,
kzFloat  x,
kzFloat  y 
)

As add touch event with details.

Useful in testing.

KANZI_API struct KzsEvent* kzsEventQueueAddSimpleWindowEvent ( struct KzsEventQueue *  queue,
enum KzsEventType  type,
struct KzsWindow window 
)

Adds a new window event into the queue.

KANZI_API struct KzsEvent* kzsEventQueueAddWindowResizeEvent ( struct KzsEventQueue *  queue,
struct KzsWindow window,
kzUint  width,
kzUint  height 
)

Adds a new window resize event into the queue.

KANZI_API struct KzsEvent* kzsEventQueueAddWindowResizeRequestedEvent ( struct KzsEventQueue *  queue,
struct KzsWindow window,
kzUint  width,
kzUint  height 
)

Adds a new window resize request event into the queue.

KANZI_API struct KzsEvent* kzsEventQueueAddWindowOrientationChangeEvent ( struct KzsEventQueue *  queue,
struct KzsWindow window,
enum KzsWindowOrientation  orientation 
)

Adds a new orientation change event into the queue.

KANZI_API struct KzsEvent* kzsEventQueueAddApplicationPausedEvent ( struct KzsEventQueue *  queue)

Adds a new application paused event.

KANZI_API struct KzsEvent* kzsEventQueueAddApplicationSleepEvent ( struct KzsEventQueue *  queue)

Adds a new application sleep event.

KANZI_API struct KzsEvent* kzsEventQueueAddApplicationWakeupEvent ( struct KzsEventQueue *  queue)

Adds a new application wakeup event.

KANZI_API struct KzsEvent* kzsEventQueueAddToggleHUDDebugEvent ( struct KzsEventQueue *  queue)

Adds a new toggle HUD debug event into the queue.

KANZI_API struct KzsEvent* kzsEventQueueAddSetHUDDebugEvent ( struct KzsEventQueue *  queue,
kzInt  onoff 
)

Adds a new set HUD debug event into the queue.

KANZI_API const struct KzsInputEventPointer* kzsInputEventGetPointingDeviceData ( const struct KzsEvent *  event)

Get the pointer event from an input event.

KANZI_API const struct KzsInputEventKey* kzsInputEventGetKeyDeviceData ( const struct KzsEvent *  event)

Get key event from an input event.

KANZI_API const struct KzsInputEventTouch* kzsInputEventGetTouchData ( const struct KzsEvent *  event)

Get touch event from an input event.

KANZI_API enum KzsEventType kzsEventGetType ( const struct KzsEvent *  event)

Get the event type.

KANZI_API kzUint kzsInputCursorGetId ( const struct KzsInputCursor *  inputdata)

Get the identifier of the touch cursor.

KANZI_API kzFloat kzsInputCursorGetPressure ( const struct KzsInputCursor *  inputData)

Gets the pressure of the touch cursor.

KANZI_API kzFloat kzsInputCursorGetRadius ( const struct KzsInputCursor *  inputData)

Gets the radius of the touch cursor.

KANZI_API kzFloat kzsInputCursorGetX ( const struct KzsInputCursor *  inputData)

Get the x coordinate of touch cursor.

KANZI_API kzFloat kzsInputCursorGetY ( const struct KzsInputCursor *  inputData)

Get the y coordinate of touch cursor.

KANZI_API enum KzsInputCursorState kzsInputCursorGetState ( const struct KzsInputCursor *  inputdata)

Get the state of the touch cursor.

KANZI_API kzUint kzsInputEventKeyGetButtonRaw ( const struct KzsInputEventKey *  inputData)

Gets the raw button code of the key device.

KANZI_API enum KzsInputKey kzsInputEventKeyGetButton ( const struct KzsInputEventKey *  inputData)

Gets the translated button of the key device.

KANZI_API enum KzsInputKeyDeviceState kzsInputEventKeyGetState ( const struct KzsInputEventKey *  inputData)

Gets the state of the key device.

KANZI_API kzU32 kzsInputEventPointerGetButtons ( const struct KzsInputEventPointer *  inputData)

Gets the bitfield of the buttons of the active pointing device.

Parameters
inputDataInput data pointer.
Returns
Bitmask of pointing device buttons, defined as KZS_POINTING_DEVICE_BUTTON_ *.
KANZI_API kzInt kzsInputEventPointerGetScroll ( const struct KzsInputEventPointer *  inputData)

Gets the scroll amount of the active pointing device.

KANZI_API enum KzsInputPointingDeviceState kzsInputEventPointerGetState ( const struct KzsInputEventPointer *  inputData)

Gets the state of the active pointing device.

KANZI_API kzInt kzsInputEventPointerGetX ( const struct KzsInputEventPointer *  inputData)

Gets the x coordinate of the active pointing device.

KANZI_API kzInt kzsInputEventPointerGetY ( const struct KzsInputEventPointer *  inputData)

Gets the y coordinate of the active pointing device.

KANZI_API struct KzsInputCursor* kzsInputEventTouchGetCursor ( const struct KzsInputEventTouch *  inputData,
kzUint  cursorIdx 
)

Get the nth cursor form a touch event.

KANZI_API kzUint kzsInputEventTouchGetCursorCount ( const struct KzsInputEventTouch *  inputData)

Get the number of cursors in this event.

KANZI_API enum KzsInputTouchState kzsInputEventTouchGetState ( const struct KzsInputEventTouch *  inputData)

Get the touch state.

Note that touch state goes DOWN when the first finger touches the screen and UP when the last finger leaves. Everything in-between is drag.

KANZI_API kzBool kzsInputEventTouchSetCursor ( struct KzsEventQueue *  queue,
struct KzsEvent *  event,
kzUint  cursorIndex,
kzUint  cursorId,
kzFloat  x,
kzFloat  y,
kzFloat  pressure,
kzFloat  radius,
enum KzsInputCursorState  state 
)

Add a cursor to a touch event.

The queue is needed for potential mirroring of the event.

Returns true if there was space for the cursor, false otherwise.

If translating pointer events, add a pointer event instead and mark the touch event as unusable.

If the event is not a touch event, do nothing unless translating.

KANZI_API void kzsInputEventTouchSetState ( struct KzsEvent *  event,
enum KzsInputTouchState  state 
)

Set the state of touch event.

This function takes a generic event structure for consistency.

If the event is not a touch event, do nothing.

KANZI_API struct KzsWindow* kzsWindowEventGetTarget ( const struct KzsEvent *  event)

Get the target window of the event.

KANZI_API kzUint kzsWindowEventResizeGetWidth ( const struct KzsEvent *  event)

Get the window width of a resize event.

KANZI_API kzUint kzsWindowEventResizeGetHeight ( const struct KzsEvent *  event)

Get the window height of a resize event.

KANZI_API enum KzsWindowOrientation kzsWindowEventOrientationChangeGetOrientation ( const struct KzsEvent *  event)

Get the window orientation of a orientation change event.

KANZI_API enum KzsInputKey kzsInputNativeGetTranslatedKey ( kzUint  button)

Returns the translated key.

KANZI_API const struct KzsDebugEventSetHUD* kzsEventGetSetHUDData ( const struct KzsEvent *  event)

Get set HUD event data from an event.

KANZI_API kzInt kzsSetHUDDebugEventGetOnOff ( const struct KzsDebugEventSetHUD *  inputData)

Returns set HUD debug event parameter.